<script>
	import {
		mapState
	} from 'vuex'
	export default {
		computed: {
			...mapState({
				loginStatus: state => state.user.loginStatus,
				userInfo: state => state.user.userInfo
			})
		},
		onLaunch: function() {
			this.$store.commit('initUser')
			let userInfo = uni.getStorageSync("userInfo");
			// console.log(this.userInfo.openID)
			if (this.userInfo == null || this.userInfo == undefined) {
				uni.redirectTo({
					url: "/pages/login/login"
				})
			} else {
				uni.reLaunch({
					url: "/pages/home/home"
				})
			}
			uni.removeStorageSync('selectedIndex'); // 清除缓存
			uni.hideTabBar()
			console.log('App Launch')

		},
		onShow: function() {
			uni.hideTabBar()
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},

	}
</script>

<style>
	/*每个页面公共css */
	@import "/wxcomponents/@vant/weapp/common/index.wxss";
</style>